import re

from bs4 import BeautifulSoup
from urllib.request import urlopen

def getImg():
    url="https://www.ivsky.com/tupian/meinv_t50/"
    html = urlopen(url).read().decode('utf-8')
    soup = BeautifulSoup(html, features='lxml')
    img_links = soup.find_all("img", {"src": re.compile('.*?\.jpg')})
    for link in img_links:
        print(link['src'])


if __name__ == '__main__':
    # if has Chinese, apply decode()
    html = urlopen("https://mofanpy.com/static/scraping/basic-structure.html").read().decode('utf-8')
    # print(html)
    soup = BeautifulSoup(html, features='lxml')
    print(soup.h1)
    print(soup.a)
    getImg()

